package com.ebupt.migu.music.api.controller;

import com.ebupt.migu.music.api.entity.MemberPopResponse;
import com.ebupt.migu.music.api.service.RefreshUserGroupSizeService;
import com.ebupt.migu.music.common.entity.ResultObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: liuyangyang@cd.ebupt.com
 * @create: 2020-11-18 17:14
 */
@Slf4j
@RestController
@RequestMapping("/api")
public class RefreshUserGroupSize {
    @Autowired
    RefreshUserGroupSizeService refreshUserGroupSizeService;

    /**
     * 同步Redis中的人群规模到MySQL数据库
     * @return
     */
    @PostMapping("/refresh_user_group_size")
    public ResultObject refresh_user_group_size(){
        log.info("同步Redis中的人群规模到MySQL数据库");
        return refreshUserGroupSizeService.refresh_user_group_size();
    }
}
